using MinimalistFoodStreet.BackEnd.Infrastructure.EFCore;
using MinimalistFoodStreet.BackEnd.Infrastructure.Dtos.Response.Tables;
using MinimalistFoodStreet.BackEnd.Infrastructure.Tools;

namespace MinimalistFoodStreet.BackEnd.Server.Server.ResponseExtend.Tables 
{
	public static class OrdersEnitityExtend 
	{
		public static ResponseOrdersDto ToResponseDto(this Order entity)
		{
			return new ResponseOrdersDto ()
			{

					id = entity.OId,
					businessId = entity.OBusinessId,
					supplierId = entity.OSupplierId,
					status = entity.OStatus,
					acceptOrderTime = entity.OAcceptOrderTime,
					acceptOrderTimeStr = Tools.TimeToString(entity.OAcceptOrderTime),
					sendTime = entity.OSendTime,
					sendTimeStr = Tools.TimeToString(entity.OSendTime),
					completeTime = entity.OCompleteTime,
					completeTimeStr = Tools.TimeToString(entity.OCompleteTime),
					payMoney = entity.OPayMoney,
					supplierMarkup = entity.OSupplierMarkup,
			};
		}
	}
}